package net.huashitong.keyan.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.keyan.dao.DubanPoJieDao;
import net.huashitong.keyan.entity.DubanPoJie;
import net.huashitong.keyan.filter.DubanPoJieFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DubanPoJieService  extends StringPKService<DubanPoJie> {

    @Autowired
    private DubanPoJieDao dao;
    @Autowired
    private SysTableService  tableService;

    @Override
    protected BaseDao<DubanPoJie, String> getDao() {
        return dao;
    }

    @Override
    protected void beforeSave(DubanPoJie obj) {
        obj.setSysId(tableService.updateMaxSysId("t_keyan_jiece_wenti",null));
    }


    public List<DubanPoJie> getList(DubanPoJieFilter filter)
    {
        return dao.getList(filter);
    }
}
